package com.witmore.neutron.ai.web.service;

import com.witmore.neutron.ai.db.entity.UserDO;
import com.witmore.neutron.ai.web.controller.vo.UserSession;
import com.witmore.neutron.ai.web.wechat.dto.WechatUserInfo;

public interface UserService {

    /**
     * 封装用户会话信息
     */
    UserSession setUserSession(Integer userId);

    /**
     * 封装用户会话信息
     */
    UserSession setUserSession(UserDO userDO);

    /**
     * 创建普通用户
     */
    UserDO createNewUserNormal(UserDO newUser);

    /**
     * 绑定用户微信openid并更新用户信息
     *
     * @param targetUser     目标用户对象
     * @param wechatUserInfo 微信用户信息（包含openid、昵称、头像等）
     * @return 绑定结果
     */
    UserBindResult bindUserOpenid(UserDO targetUser, WechatUserInfo wechatUserInfo);

    /**
     * 会话充值记录
     */
    void createRechargeRecord(UserDO user, Integer sessionTimes, String operationDesc, Integer operatorId, String operatorName,
                              Integer beforeRemainingTimes, Integer afterRemainingTimes);

    /**
     * 会话充值/扣款记录
     */
    void createRechargeRecord(UserDO user, Integer sessionTimes, String operationDesc, Integer operatorId, String operatorName,
                              Integer beforeRemainingTimes, Integer afterRemainingTimes, Integer operationType);
}
